<template>
    <div class='fxn-body'>
        <div class="fxn-wrap">
            <div class="fxn-wrap-left">
                <div class="info"><i class="iconfont icon-tasklist"></i>字典类型</div>
                <div class="rows">
                    <div class="item" v-for="(item,index) in dataType" :key="index" :class="[typeActive == item.value ? 'active' : '']" @click="handlePath(item.value)">
                        <div class="content">{{item.label}}</div>
                    </div>
                </div>
            </div>
            <div class="fxn-wrap-right">
                <UploadFile v-if="typeActive == 1"></UploadFile>
                <FollowRecords v-if="typeActive == 2"></FollowRecords>
            </div>
        </div>
    </div>
</template>

<script>
    import { defineComponent, reactive, getCurrentInstance, onMounted, toRefs, computed } from 'vue'
    import { useRouter } from 'vue-router'
    import { useStore } from 'vuex'
    import UploadFile from './DataManage/UploadFile.vue'
    import FollowRecords from './DataManage/FollowRecords.vue'
    export default defineComponent({
        components: {
            UploadFile,
            FollowRecords,
        },
        setup() {
            const { proxy } = getCurrentInstance();
            const router = useRouter();
            const store = useStore();

            //初始化数据
            const state = reactive({
                typeActive: 1,
                dataType: [
                    {value: 1, label: '允许上传文件类型'},
                    {value: 2, label: '跟进记录类型'},
                ],
            })

            //选中类型
            const handlePath = (type) => {
                state.typeActive = type;
            }
            
            //Dom加载
            onMounted(()=>{
                
            })
            
            return {
                ...toRefs(state),
                
                //请求方法
                handlePath,
                
                //组件方法
            }

        },
    })
</script>

<style scoped>
    
</style>